package ar.globals;

import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

import android.net.ConnectivityManager;
import android.os.Vibrator;
import ar.Location.Map.MyOverlayItem;
import ar.Location.Route.RoutePoint;
import ar.camera.glsurfaceview.base.BaseGLSurfaceView;
import ar.camera.pojo.GeoLocation;
import ar.camera.surfaceview.CameraSurfaceView;
import ar.camera.thread.MainClientThread;
import ar.sql.ShareRoute;
import ar.sql.ShareRoutePoint;
import arserver.pojo.RegistrationItem;

import com.google.android.maps.GeoPoint;

public class Globals {

	public static boolean isEnable1 = true;
	public static boolean isEnable2 = false;
	public static boolean isEnable3 = false;
	public static boolean isEnable31_32 = false;
	public static boolean isEnable4 = false;

	public static String serverAddress = "cammapserver.mooo.com";
	public static Socket client1Socket;
	public static Socket client2Socket;

	public static MainClientThread mainClient1Thread;
	public static MainClientThread mainClient2Thread;

	public static String LAT = "";
	public static String LNG = "";
	
	public static GeoPoint getMyLocation() {
		if(LAT != null && LNG != null) {
			if(LAT.length() > 0 && LNG.length() > 0) {
				float latitude = Float.parseFloat(LAT);
				float longitude = Float.parseFloat(LNG);
				int intergerLAT = (int)(latitude * 1E6);
				int intergerLNG = (int)(longitude * 1E6);
				GeoPoint result = new GeoPoint(intergerLAT, intergerLNG);
				return result;
			}
		}
		return null;
	}	
	
	public static String phoneNumber = "";
	public static String nickName = "";
	public static String phoneNumberOfSharingFriend = "";
	public static List<String> phoneNumbersOfSharedFriends = new ArrayList<String>();

	public final static String STR_REGISTER_PHONE_NUMBERS = "registerPhoneNumbers";
	public final static String STR_GET_REGISTRATION_LIST = "getRegistrationList";
	public final static String STR_SHARE_LAT_LNG = "shareLatLng";
	public final static String STR_GET_LAT_LNG = "getLatLng";
	public final static String STR_DISCONNECT = "disConnect";

	public final static int MSG_GET_STRING = 0;
	public final static int MSG_GET_REGISTRATION_ITEM = 1;
	public final static int MSG_GET_REGISTRATION_LIST = 2;
	public final static int MSG_CONNECT_SUCCESSFULLY = 3;
	public final static int MSG_CONNECT_FAILED = 4;

	public static ConnectivityManager connectivityManager;
	public static List<RegistrationItem> registrationList = new ArrayList<RegistrationItem>();
	public static boolean isSharingLocation = false;
	public static boolean isTrackingOnCam = false;
	public static String shareCode = "";
	public static boolean isNeedSendMessage = false;
	public static String trackCode = "";
	public static String routeDesc = "";
	public static List<RegistrationItem> routePoints = new ArrayList<RegistrationItem>();
	public static List<ShareRoutePoint> loadedRoutePoints = new ArrayList<ShareRoutePoint>();	
	public static List<ShareRoute> loadedRoutes = new ArrayList<ShareRoute>();	
	
	
	// Camera
	public static boolean isShowPlane = true;
	public static Vibrator vibrator;
	public static CameraSurfaceView arCameraView;
	public static BaseGLSurfaceView planeView;
	public static BaseGLSurfaceView locationIconView;
	public static BaseGLSurfaceView compassView;
	public static List<GeoLocation> listOfGeoLocations = new ArrayList<GeoLocation>();
	public static GeoLocation currentGeoLocation;
	public static List<MyOverlayItem> markers = new ArrayList<MyOverlayItem>();
	public static MyOverlayItem currOverlayItem = null;
	
	public static int MAX_NUMBER_OF_SEARCHED_LOCATIONS = 10;
	public static int RADIUS = 10000;
	public static int MAX_RADIUS = 15000;
	public static float PERIOD_OF_UPDATING = 5000f;

	public static int mode;
	public static int NONE = -1;
	public static int SHORT_PRESS = 0;
	public static int LONG_PRESS = 1;

	// Route
	public static float routeAzimut = 0;
	public static List<RoutePoint> listOfRoutePoints = new ArrayList<RoutePoint>();	
	public static GeoLocation routeOriginGeo;
	public static boolean isNeedUpdatedRouteCompass = false;
	public final static int UPDATE_ROUTE_COMPASS = 1; 
	public static boolean isFinishedARRoute = false;
	public static float velocity = 0;

	
}
